package a.f.g;

import a.c.e;
import a.c.w;
import a.f.mb;
import a.f.o;
import a.f.wc;
import a.i.h;
import a.i.wb;

import java.util.Arrays;

public class d
  extends mb
{
  private int w;
  private double[] x;
  private double[] y;
  private double[] z;
  private double[] A;
  private double[] B;
  private double[] C;
  private double[] D;
  private double[] E;
  private double[] F;
  private double[] G;
  private int H = 40;
  private double I = this.H * this.H;
  private int J = 15;
  private int K = 3;
  private int L = 10;
  private int M = 25;
  private int N;
  private int[] O;
  private e[] P;
  private b_ Q;
  private int[] R;
  private e[] S;
  private int[] T;
  private o U;
  private e[] V;
  private double W;
  private int[] X;
  private a_[][] Y;
  private wb Z;
  private double ab = 2.0D;
  private double bb;
  private double cb;
  private int[] db;
  private int[] eb;
  private double[][] fb = new double[6][6];
  private int[] gb = new int[3];
  private double[] hb = new double[6];
  private double[] ib = new double[6];
  private h jb;
  private int kb;
  private boolean lb = true;
  private boolean mb = false;
  private boolean nb;
  public static boolean ob;
  
  public boolean b(o paramo)
  {
    return paramo != null;
  }
  
  public void a(int paramInt)
  {
    this.L = paramInt;
  }
  
  public void b(int paramInt)
  {
    this.M = paramInt;
  }
  
  public void c(int paramInt)
  {
    this.H = paramInt;
  }
  
  public void d(int paramInt)
  {
    this.J = paramInt;
  }
  
  public int a()
  {
    return this.L;
  }
  
  public int s()
  {
    return this.M;
  }
  
  public int t()
  {
    return this.H;
  }
  
  public int u()
  {
    return this.J;
  }
  
  public void a(o paramo)
  {
    boolean bool = j.c;
    int i4 = j.b;
    if (!bool) {
      if (paramo != null)
      {
        if (bool) {
          break label57;
        }
        if (paramo.j() >= 2) {
          break label47;
        }
      }
    }
    if ((bool) || (paramo != null)) {
      wc.a(paramo, true);
    }
    return;
    label47:
    label57:
    e locale1;
    if (!bool)
    {
      if (paramo.j() == 2)
      {
        wc.a(paramo, true);
        w localw = paramo.v();
        locale1 = localw.d();
        if (!bool)
        {
          paramo.a(locale1, 0.0D, 0.0D);
          localw.f();
          if (this.nb)
          {
            if (bool) {
              break label166;
            }
            paramo.a(localw.d(), 0.0D, this.H + paramo.t(localw.d()) / 2.0D + paramo.t(locale1) / 2.0D);
            if (i4 == 0) {
              break label169;
            }
          }
        }
        label166:
        paramo.a(localw.d(), 0.0D, this.H);
        label169:
        return;
      }
      this.V = paramo.t();
    }
    if (!bool)
    {
      if (this.nb)
      {
        this.W = 0.0D;
        i = this.V.length - 1;
        do
        {
          if (i < 0) {
            break;
          }
          locale1 = this.V[i];
          if (bool) {
            break label291;
          }
          this.W += (paramo.s(locale1) + paramo.t(locale1)) / 4.0D;
          i--;
          if (i4 != 0) {
            break label276;
          }
        } while (i4 == 0);
        if (!bool) {
          this.W /= this.V.length;
        }
        label276:
        label291:
        this.H = ((int)(this.H + 2.0D * this.W));
      }
      e(paramo);
    }
    int i = this.N - 1;
    w();
    int j = this.L - 1;
    do
    {
      do
      {
        if (j <= 0) {
          break;
        }
        a(i, false);
        j--;
        if (bool) {
          break label359;
        }
        if (i4 != 0) {
          break label358;
        }
      } while (i4 == 0);
    } while (bool);
    i = this.N - 2;
    label358:
    label359:
    if (i >= 0) {}
    label438:
    label495:
    label887:
    label888:
    while (bool)
    {
      j = this.O[i];
      if (i4 != 0) {
        break label1003;
      }
      double d;
      if (i > 0)
      {
        d = this.J * (1 << (i - 1) * 2) * (1 + this.H / 80);
        if (bool) {
          break label438;
        }
        if (i4 == 0) {}
      }
      else
      {
        d = this.J * 0.5F * (1 + this.H / 80);
      }
      int k = j - 1;
      do
      {
        do
        {
          if (k < 0) {
            break;
          }
          this.x[this.P[k].f()] = d;
          k--;
          if ((!bool) && (i4 != 0)) {
            break label495;
          }
        } while (i4 == 0);
      } while (bool);
      k = this.O[(i + 1)];
      do
      {
        if (k >= j) {
          break;
        }
        e locale2 = this.P[k];
        int m = locale2.f();
        b(locale2);
        int n = this.S[0].f();
        int i1 = this.S[1].f();
        int i2 = this.S[2].f();
        if (bool) {
          break label888;
        }
        if (i4 != 0) {
          break label887;
        }
        if (this.lb)
        {
          a(0, 1, 0);
          a(0, 2, 2);
          a(1, 2, 4);
          e(m);
          if (bool) {
            break label679;
          }
          if (i4 == 0) {}
        }
        else
        {
          this.F[m] = ((this.F[n] + this.F[i1] + this.F[i2]) / 3.0D);
          this.G[m] = ((this.G[n] + this.G[i1] + this.G[i2]) / 3.0D);
        }
        int i3 = 2;
        do
        {
          do
          {
            if (i3 <= 0) {
              break label868;
            }
            a(locale2, 3);
            a(locale2);
            this.C[m] = this.A[m];
            this.D[m] = this.B[m];
            this.y[m] = this.z[m];
            this.A[m] *= this.x[m];
            this.B[m] *= this.x[m];
            if (i4 != 0) {
              break;
            }
            if (this.z[m] != 0.0D)
            {
              this.A[m] /= this.z[m];
              this.B[m] /= this.z[m];
            }
            this.F[m] += this.A[m];
            this.G[m] += this.B[m];
            i3--;
          } while (i4 == 0);
          k++;
        } while (bool);
      } while (i4 == 0);
      if (!bool)
      {
        if (bool) {
          break label944;
        }
        if (i < 1)
        {
          k = this.M - 1;
          do
          {
            if (k <= 0) {
              break;
            }
            a(i, true);
            k--;
            if (bool) {
              break label991;
            }
            if (i4 != 0) {
              break label989;
            }
          } while (i4 == 0);
        }
      }
      if (!bool)
      {
        k = (this.L - 1) * (1 + i * i);
        if (k > 0)
        {
          a(i, false);
          k--;
        }
        for (;;)
        {
          if (!bool) {
            if (i4 == 0)
            {
              if (i4 == 0) {
                break;
              }
              if (bool) {
                continue;
              }
              i--;
            }
          }
        }
      }
      if (i4 == 0) {
        break;
      }
    }
    label679:
    label868:
    if (this.nb) {
      label1003:
      this.H = ((int)(this.H - 2.0D * this.W));
    }
    label944:
    label989:
    label991:
    j = this.w - 1;
    if (j >= 0)
    {
      paramo.a(this.V[j], this.F[j], this.G[j]);
      j--;
    }
    for (;;)
    {
      if ((bool) || (i4 == 0))
      {
        if (i4 == 0) {
          break;
        }
        if (!bool) {
          v();
        }
      }
    }
  }
  
  private void v()
  {
    this.V = null;
    this.jb = null;
    this.db = null;
    this.eb = null;
    this.A = null;
    this.B = null;
    this.x = null;
    this.y = null;
    this.z = null;
    this.C = null;
    this.D = null;
    this.E = null;
    this.F = null;
    this.G = null;
    this.X = null;
    this.Y = ((a_[][])null);
    this.S = null;
    this.T = null;
    this.O = null;
    this.P = null;
    this.R = null;
  }
  
  private void e(int paramInt)
  {
    boolean bool = j.c;
    int i1 = j.b;
    double d1 = 0.0D;
    double d2 = 0.0D;
    int i = 0;
    do
    {
      if (i >= 6) {
        break;
      }
      int j = i + 1;
      if (j < 6)
      {
        double tmp122_119 = Math.sqrt((this.hb[i] - this.hb[j]) * (this.hb[i] - this.hb[j]) + (this.ib[i] - this.ib[j]) * (this.ib[i] - this.ib[j]));
        this.fb[j][i] = tmp122_119;
        this.fb[i][j] = tmp122_119;
        j++;
      }
      for (;;)
      {
        if (!bool) {
          if (tmp122_119 == 0)
          {
            if (tmp122_119 == 0) {
              break;
            }
            if (bool) {
              continue;
            }
            i++;
          }
        }
      }
    } while (tmp122_119 == 0);
    double d3 = 1.7976931348623157E+308D;
    int k = 0;
    label188:
    do
    {
      do
      {
        break label188;
        if (k >= 6) {
          break;
        }
        int m = k + 1;
        do
        {
          if (m >= 6) {
            break label298;
          }
          if (tmp122_119 != 0) {
            break;
          }
          int n = m + 1;
          do
          {
            do
            {
              if (n >= 6) {
                break label285;
              }
              double d4 = this.fb[k][m] + this.fb[k][n] + this.fb[m][n];
              if (tmp122_119 != 0) {
                break;
              }
              if (d4 < d3)
              {
                d3 = d4;
                this.gb[0] = k;
                this.gb[1] = m;
                this.gb[2] = n;
              }
              n++;
            } while (tmp122_119 == 0);
            m++;
          } while (bool);
        } while (tmp122_119 == 0);
        k++;
      } while (bool);
    } while (tmp122_119 == 0);
    label285:
    label298:
    this.F[paramInt] = ((this.hb[this.gb[0]] + this.hb[this.gb[1]] + this.hb[this.gb[2]]) / 3.0D);
    this.G[paramInt] = ((this.ib[this.gb[0]] + this.ib[this.gb[1]] + this.ib[this.gb[2]]) / 3.0D);
  }
  
  private void a(int paramInt1, int paramInt2, int paramInt3)
  {
    boolean bool = j.c;
    int k = j.b;
    int i = this.S[paramInt1].f();
    int j = this.S[paramInt2].f();
    double d1 = this.F[j] - this.F[i];
    double d2 = this.G[j] - this.G[i];
    double d3 = this.T[paramInt1] * this.H * 0.5F;
    double d4 = this.T[paramInt2] * this.H * 0.5F;
    double d5 = Math.sqrt(d1 * d1 + d2 * d2);
    if (!bool) {
      if (d5 > 0.0D)
      {
        double d6 = (d4 * d4 - d3 * d3 - d5 * d5) / (-2.0D * d5);
        double d7 = d3 * d3 - d6 * d6;
        if (!bool) {
          if (d7 > 0.0D)
          {
            d8 = Math.sqrt(d7);
            this.hb[paramInt3] = (this.F[i] + (d1 * d6 + d2 * d8) / d5);
            this.ib[paramInt3] = (this.G[i] + (d2 * d6 - d1 * d8) / d5);
            this.hb[(++paramInt3)] = (this.F[i] + (d1 * d6 - d2 * d8) / d5);
            this.ib[paramInt3] = (this.G[i] + (d2 * d6 + d1 * d8) / d5);
            if ((!bool) && (k == 0)) {
              return;
            }
          }
        }
        if (!bool)
        {
          if (d3 > d4 + d5)
          {
            d8 = (d3 + d4 + d5) / (2.0D * d5);
            if (bool) {
              break label480;
            }
            if (k == 0) {
              break label417;
            }
          }
          if (bool) {}
        }
        else if (d4 > d3 + d5)
        {
          d8 = (-d3 + (d5 - d4)) / (2.0D * d5);
          if (bool) {
            break label480;
          }
          if (k == 0) {
            break label417;
          }
        }
        double d8 = (d3 + (d5 - d4)) / (2.0D * d5);
        label417:
        tmp442_441 = (this.F[i] + d1 * d8);
        this.hb[(1 + paramInt3)] = tmp442_441;
        this.hb[paramInt3] = tmp442_441;
        double tmp470_469 = (this.G[i] + d2 * d8);
        this.ib[(1 + paramInt3)] = tmp470_469;
        this.ib[paramInt3] = tmp470_469;
        if (!bool) {
          if (k == 0) {
            label480:
            return;
          }
        }
      }
      else
      {
        double tmp502_501 = this.F[i];
        this.hb[(1 + paramInt3)] = tmp502_501;
        this.hb[paramInt3] = tmp502_501;
      }
    }
    double tmp524_523 = this.G[i];
    this.ib[(1 + paramInt3)] = tmp524_523;
    this.ib[paramInt3] = tmp524_523;
  }
  
  private void a(int paramInt, boolean paramBoolean)
  {
    boolean bool = j.c;
    int m = j.b;
    int i = this.O[paramInt];
    int j = 0;
    label90:
    int k;
    do
    {
      if (j >= i) {
        break;
      }
      if (m != 0) {
        break label243;
      }
      if (paramBoolean)
      {
        d(this.P[j], paramInt);
        if (bool) {
          break label90;
        }
        if (m == 0) {}
      }
      else
      {
        b(this.P[j], paramInt);
      }
      a(this.P[j]);
      k = this.P[j].f();
      this.C[k] = this.A[k];
      this.D[k] = this.B[k];
      this.y[k] = this.z[k];
      this.A[k] *= this.x[k];
      this.B[k] *= this.x[k];
      if (!bool)
      {
        if (this.z[k] != 0.0D)
        {
          this.A[k] /= this.z[k];
          this.B[k] /= this.z[k];
        }
        j++;
      }
    } while (m == 0);
    if (!bool) {
      label243:
      j = 0;
    }
    do
    {
      if (j >= i) {
        break;
      }
      k = this.P[j].f();
      this.F[k] += this.A[k];
      this.G[k] += this.B[k];
      j++;
    } while (m == 0);
  }
  
  private void w()
  {
    boolean bool = j.c;
    int m = j.b;
    int i = this.N - 1;
    int j = this.O[i];
    double d1 = 0.0D;
    double d2 = 0.0D;
    double d3 = (1 << this.N) * (this.H / 4);
    int k = 0;
    do
    {
      do
      {
        if (k >= this.K) {
          break;
        }
        e locale = this.P[k];
        this.F[locale.f()] = (Math.sin(k * 3.141592653589793D * 2.0D / this.K) * d3);
        this.G[locale.f()] = (Math.cos(k * 3.141592653589793D * 2.0D / this.K) * d3);
        b(locale);
        k++;
        if (bool) {
          break label166;
        }
        if (m != 0) {
          break label164;
        }
      } while (m == 0);
    } while (bool);
    k = 0;
    label164:
    label166:
    if (k < j) {
      d1 += this.F[this.P[k].f()];
    }
    do
    {
      d2 += this.G[this.P[k].f()];
      k++;
      if (bool) {
        break label244;
      }
      if (m != 0) {
        break label243;
      }
      if (m == 0) {
        break;
      }
      d1 /= j;
    } while (bool);
    d2 /= j;
    label243:
    label244:
    k = 0;
    do
    {
      while (m == 0)
      {
        if (k >= j) {
          break;
        }
        this.F[this.P[k].f()] -= d1;
        this.G[this.P[k].f()] -= d2;
        k++;
      }
    } while (bool);
  }
  
  private void e(o paramo)
  {
    boolean bool = j.c;
    int j = j.b;
    this.U = paramo;
    if (!bool) {
      if (this.mb)
      {
        this.Z = new wb(42L);
        if (bool) {
          break label379;
        }
        if (j == 0) {
          break label60;
        }
      }
    }
    this.Z = new wb();
    label60:
    wc.a(paramo, true);
    this.w = paramo.k();
    this.kb = 0;
    this.jb = new h(this.w + 1);
    this.db = new int[this.w];
    this.eb = new int[this.w];
    this.S = new e[3];
    this.T = new int[3];
    this.I = (this.H * this.H);
    this.bb = (this.I * this.H / (2.0D * this.ab));
    this.cb = (1.0D / (2.0D * this.ab * this.H));
    this.K = Math.min(this.w, this.K);
    this.Q = a(paramo, this.K);
    this.N = this.Q.a;
    this.O = this.Q.b;
    this.P = this.Q.c;
    this.R = this.Q.e;
    this.x = new double[this.w];
    this.y = new double[this.w];
    this.z = new double[this.w];
    this.A = new double[this.w];
    this.B = new double[this.w];
    this.C = new double[this.w];
    this.D = new double[this.w];
    this.E = new double[this.w];
    this.F = new double[this.w];
    this.G = new double[this.w];
    x();
    this.Y = new a_[this.w][this.N];
    label379:
    do
    {
      for (int i = 0; j == 0; i++)
      {
        if (i >= this.w) {
          break;
        }
        this.x[i] = this.J;
        this.E[i] = 1.0D;
        this.C[i] = 0.0D;
        this.D[i] = 0.0D;
        this.A[i] = 0.0D;
        this.B[i] = 0.0D;
        this.F[i] = paramo.m(this.V[i]);
        this.G[i] = paramo.n(this.V[i]);
      }
    } while (bool);
  }
  
  private void a(e parame, int paramInt)
  {
    boolean bool = j.c;
    int n = j.b;
    int i = parame.f();
    double d1 = this.F[i];
    double d2 = this.G[i];
    double d3 = 0.0D;
    double d4 = 0.0D;
    int j = paramInt - 1;
    if (j >= 0) {}
    do
    {
      int k;
      double d5 = this.F[(k = this.S[j].f())] - d1;
      double d6 = this.G[k] - d2;
      double d7 = d5 * d5 + d6 * d6;
      if ((!bool) && (n != 0)) {
        return;
      }
      if (!bool)
      {
        if (d7 > 0.0D)
        {
          int m = this.T[j];
          double d8 = m * m;
          double d9 = (d7 / (d8 * this.I) - 1.0D) / (Math.sqrt(d7) * m);
          d3 += d9 * d5;
          d4 += d9 * d6;
        }
        j--;
      }
      if (n == 0) {
        break;
      }
      this.A[i] = d3;
      this.B[i] = d4;
    } while (bool);
    this.z[i] = Math.sqrt(d3 * d3 + d4 * d4);
  }
  
  private void b(e parame, int paramInt)
  {
    boolean bool = j.c;
    int n = j.b;
    int i = parame.f();
    e[] arrayOfe = this.Y[i][paramInt].a;
    int[] arrayOfInt = this.Y[i][paramInt].b;
    double d1 = 0.0D;
    double d2 = 0.0D;
    int j = this.X[paramInt] - 1;
    do
    {
      if (j < 0) {
        break;
      }
      int k = arrayOfe[j].f();
      int m = arrayOfInt[j];
      if ((!bool) && (n != 0)) {
        return;
      }
      if (!bool)
      {
        if (m != 0)
        {
          double d3 = this.F[k] - this.F[i];
          double d4 = this.G[k] - this.G[i];
          double d5 = d3 * d3 + d4 * d4;
          if (!bool) {
            if (d5 == 0.0D)
            {
              d3 = this.Z.a(-0.5D, 0.5D);
              d4 = this.Z.a(-0.5D, 0.5D);
              d5 = 0.01D;
            }
          }
          double d6 = m * m;
          double d7 = (d5 / (d6 * this.I) - 1.0D) / (Math.sqrt(d5) * m);
          d1 += d3 * d7;
          d2 += d4 * d7;
        }
        j--;
      }
    } while (n == 0);
    this.A[i] = d1;
    this.B[i] = d2;
    if (!bool) {
      this.z[i] = Math.sqrt(d1 * d1 + d2 * d2);
    }
  }
  
  private void d(e parame, int paramInt)
  {
    boolean bool = j.c;
    int m = j.b;
    int i = parame.f();
    e[] arrayOfe = this.Y[i][paramInt].a;
    double d2;
    double d1 = d2 = 0.0D;
    a.c.d locald = parame.i();
    int k;
    double d3;
    double d4;
    double d5;
    double d6;
    do
    {
      do
      {
        if (locald == null) {
          break;
        }
        d3 = this.F[(k = locald.e().f())] - this.F[i];
        d4 = this.G[k] - this.G[i];
        d5 = d3 * d3 + d4 * d4;
        d6 = Math.sqrt(d5) * this.cb;
        d1 += d3 * d6;
        d2 += d4 * d6;
        if (bool) {
          break label166;
        }
        locald = locald.j();
        if (m != 0) {
          break label164;
        }
      } while (m == 0);
    } while (bool);
    locald = parame.h();
    label164:
    label166:
    do
    {
      if (locald == null) {
        break;
      }
      d3 = this.F[(k = locald.f().f())] - this.F[i];
      if (m != 0) {
        break label273;
      }
      d4 = this.G[k] - this.G[i];
      d5 = d3 * d3 + d4 * d4;
      d6 = Math.sqrt(d5) * this.cb;
      d1 += d3 * d6;
      d2 += d4 * d6;
      locald = locald.i();
    } while (m == 0);
    label273:
    int j = this.X[paramInt] - 1;
    if (j >= 0) {}
    do
    {
      d3 = this.F[i] - this.F[(k = arrayOfe[j].f())];
      d4 = this.G[i] - this.G[k];
      d5 = d3 * d3 + d4 * d4;
      if (!bool)
      {
        if (m != 0) {
          return;
        }
        if (bool) {}
      }
      else if (d5 == 0.0D)
      {
        d3 = this.Z.a(-0.5D, 0.5D);
        d4 = this.Z.a(-0.5D, 0.5D);
        d5 = 0.01D;
      }
      d6 = this.bb / (d5 * Math.sqrt(d5));
      d1 += d3 * d6;
      d2 += d4 * d6;
      j--;
      if (m == 0) {
        break;
      }
      this.A[i] = d1;
      this.B[i] = d2;
    } while (bool);
    this.z[i] = Math.sqrt(d1 * d1 + d2 * d2);
  }
  
  private void a(e parame)
  {
    boolean bool = j.c;
    int i = parame.f();
    double d1 = this.x[i];
    double d2 = this.y[i];
    double d3 = this.z[i];
    if ((bool) || ((d3 != 0.0D) && ((bool) || (d2 != 0.0D))))
    {
      double d4 = this.A[i] * this.C[i] + this.B[i] * this.D[i];
      double d5 = d4 / (d3 * d2);
      if (!bool) {
        if (this.E[i] * d5 > 0.0D)
        {
          d1 += d5 * 0.45D;
          if (bool) {
            break label152;
          }
          if (j.b == 0) {
            break label144;
          }
        }
      }
      d1 += d5 * 0.15D;
      label144:
      this.E[i] = d5;
      label152:
      this.x[i] = d1;
    }
  }
  
  private void x()
  {
    boolean bool = j.c;
    int k = j.b;
    double d1 = 10000.0D;
    int i = 0;
    double d2 = this.U.l() * 2;
    if (!bool) {
      if (d2 < d1) {
        d2 = d1;
      }
    }
    int j = 0;
    do
    {
      if (j >= this.N) {
        break;
      }
      if (k != 0) {
        break label121;
      }
      if (this.O[j] * this.O[j] - d1 <= 0.0D)
      {
        i = j;
        if (bool) {
          break label120;
        }
        if (k == 0) {
          break;
        }
      }
      j++;
    } while (k == 0);
    this.X = new int[this.N];
    if (!bool) {
      label120:
      label121:
      j = 0;
    }
    if (j < this.N) {
      if (!bool)
      {
        if (j >= i) {
          this.X[j] = Math.max(this.O[j] - 1, this.K - 1);
        }
      }
      else
      {
        if (bool) {
          break label235;
        }
        if (k == 0) {
          break label230;
        }
      }
    }
    label230:
    label235:
    do
    {
      this.X[j] = Math.max(this.K - 1, Math.min((int)(a(j, 0, 2, 10000, 1) * d2 / this.O[j]), this.O[j] - 1));
      j++;
      if (k == 0) {
        break;
      }
      this.X[0] = Math.min(2 * this.X[0], this.w - 1);
    } while (bool);
  }
  
  private static final double a(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5)
  {
    boolean bool = j.c;
    if (!bool)
    {
      if (paramInt1 <= paramInt2) {
        return paramInt3;
      }
      if (bool) {}
    }
    else if (paramInt2 <= paramInt1)
    {
      if (bool) {
        break label59;
      }
      if (paramInt1 <= paramInt4) {
        return (paramInt5 - paramInt3) / (paramInt4 - paramInt2) * (paramInt1 - paramInt2) + paramInt3;
      }
    }
    label59:
    return paramInt5;
  }
  
  private void b(e parame)
  {
    boolean bool = j.c;
    int i7 = j.b;
    int i = ++this.kb;
    int j = parame.f();
    this.jb.d();
    int k = 0;
    int m = 0;
    int n = 3;
    int i1 = 0;
    int[] arrayOfInt = new int[this.R[j] + 1];
    int i2 = this.R[j];
    int i3;
    do
    {
      while (i7 == 0)
      {
        if (i2 < 0) {
          break;
        }
        this.Y[j][i2] = new a_();
        this.Y[j][i2].a = new e[this.X[i2]];
        this.Y[j][i2].b = new int[this.X[i2]];
        i2--;
      }
      i3 = 1;
    } while (bool);
    e locale1 = parame;
    this.db[locale1.f()] = i;
    int i4 = 1;
    a.c.d locald = locale1.i();
    if (locald == null)
    {
      locald = locale1.h();
      i4 = 0;
    }
    label482:
    do
    {
      do
      {
        do
        {
          if (locald == null) {
            break label539;
          }
          if (i7 != 0) {
            break label551;
          }
          e locale2 = i4 != 0 ? locald.e() : locald.f();
          int i5 = locale2.f();
          if (!bool) {
            if (this.db[i5] != i)
            {
              this.db[i5] = i;
              this.jb.b(locale2);
              this.eb[i5] = i3;
              int i6 = Math.min(this.R[i5], this.R[j]);
              i2 = i1;
              do
              {
                do
                {
                  if (i2 > i6) {
                    break;
                  }
                  if (bool) {
                    break label582;
                  }
                  if (i7 != 0) {
                    break label577;
                  }
                  if (arrayOfInt[i2] < this.X[i2])
                  {
                    this.Y[j][i2].a[arrayOfInt[i2]] = locale2;
                    tmp354_352 = i2;
                    tmp354_350 = arrayOfInt;
                    tmp356_355 = tmp354_350[tmp354_352];
                    tmp354_350[tmp354_352] = (tmp356_355 + 1);
                    this.Y[j][i2].b[tmp356_355] = i3;
                    if (bool) {
                      continue;
                    }
                    if (i7 == 0) {}
                  }
                  else
                  {
                    if (bool) {
                      continue;
                    }
                    if (i2 == i1) {
                      i1++;
                    }
                  }
                  i2++;
                } while (i7 == 0);
              } while (bool);
              if (bool) {
                break label482;
              }
              if (k == 0)
              {
                if (bool) {
                  break label482;
                }
                if (m < n)
                {
                  if (bool) {
                    break label482;
                  }
                  if (this.R[i5] > this.R[j])
                  {
                    this.T[m] = i3;
                    this.S[(m++)] = locale2;
                    if (bool) {
                      break label482;
                    }
                    if (m == n) {
                      k = 1;
                    }
                  }
                }
              }
            }
          }
          if (bool) {
            break label536;
          }
          if (i4 == 0) {
            break label527;
          }
          locald = locald.j();
          if (bool) {
            break;
          }
        } while (locald != null);
        i4 = 0;
        locald = locale1.h();
        if (bool) {
          break label536;
        }
      } while (i7 == 0);
      locald = locald.i();
    } while (i7 == 0);
    label527:
    label536:
    label539:
    label551:
    label577:
    label582:
    label623:
    do
    {
      do
      {
        if ((bool) || (!this.jb.g()))
        {
          locale1 = (e)this.jb.b();
          i3 = this.eb[locale1.f()] + 1;
          if ((!bool) && ((k != 0) && (bool))) {
            break label623;
          }
          if ((i1 <= this.R[j]) && (this.jb.e() >= 0)) {
            break;
          }
        }
      } while (bool);
    } while (i7 != 0);
  }
  
  public boolean y()
  {
    return this.lb;
  }
  
  public void h(boolean paramBoolean)
  {
    this.lb = paramBoolean;
  }
  
  public boolean z()
  {
    return this.mb;
  }
  
  public void i(boolean paramBoolean)
  {
    this.mb = paramBoolean;
  }
  
  public double A()
  {
    return this.ab;
  }
  
  public void a(double paramDouble)
  {
    this.ab = paramDouble;
  }
  
  public boolean B()
  {
    return this.nb;
  }
  
  public void j(boolean paramBoolean)
  {
    this.nb = paramBoolean;
  }
  
  static int[] a(o paramo, e[] paramArrayOfe, int paramInt1, int paramInt2)
  {
    boolean bool = j.c;
    int i2 = j.b;
    int i = 1 << paramInt2;
    int k = 0;
    int[] arrayOfInt1 = new int[paramInt1 + 1];
    int m = 0;
    Arrays.fill(arrayOfInt1, -1);
    h localh1 = new h(paramo.j());
    h localh2 = new h(paramo.j() + i + 1);
    int[] arrayOfInt2 = new int[paramo.j()];
    int n = 0;
    do
    {
      do
      {
        if (n >= paramArrayOfe.length) {
          break;
        }
        if ((!bool) && (i2 != 0)) {
          break label124;
        }
        arrayOfInt2[paramArrayOfe[n].f()] = n;
        n++;
      } while (i2 == 0);
    } while (bool);
    label124:
    int[] arrayOfInt3 = new int[paramo.j()];
    int j = 0;
    if (j < paramInt1) {}
    label259:
    label261:
    while (bool)
    {
      if (bool) {
        break label274;
      }
      if (i2 != 0) {
        break label272;
      }
      if (arrayOfInt1[(j + 1)] == -1)
      {
        a(paramo, paramArrayOfe[j], i, j + 1, localh2, arrayOfInt3, localh1);
        k++;
        arrayOfInt1[(j + 1)] = 1;
        localh1.b();
        do
        {
          do
          {
            int i1;
            do
            {
              if (localh1.g()) {
                break;
              }
              i1 = arrayOfInt2[((e)localh1.b()).f()];
            } while (i1 >= paramInt1);
            arrayOfInt1[(i1 + 1)] = 0;
            if ((bool) || (bool)) {
              break label261;
            }
            if (i2 != 0) {
              break label259;
            }
          } while (bool);
        } while (i2 == 0);
      }
      j++;
      if (i2 == 0) {
        break;
      }
    }
    label272:
    label274:
    arrayOfInt1[0] = k;
    return arrayOfInt1;
  }
  
  static void a(o paramo, e parame, int paramInt1, int paramInt2, h paramh1, int[] paramArrayOfInt, h paramh2)
  {
    boolean bool = j.c;
    int j = j.b;
    paramh1.d();
    paramh1.a(parame);
    paramh1.a(null);
    break label226;
    if (!paramh1.g()) {
      parame = (e)paramh1.b();
    }
    label123:
    while (bool)
    {
      if (!bool)
      {
        if (parame == null)
        {
          paramInt1--;
          if ((!bool) && (paramInt1 == 0)) {
            continue;
          }
          if (!bool)
          {
            if (paramh1.g()) {
              continue;
            }
            if (bool) {
              break label123;
            }
          }
          if (!paramh1.g())
          {
            paramh1.a(null);
            parame = (e)paramh1.b();
            if (bool) {
              break label136;
            }
            if (parame == null) {
              continue;
            }
          }
        }
        paramh2.a(parame);
        paramArrayOfInt[parame.f()] = paramInt2;
      }
      a.c.d locald = parame.h();
      e locale;
      int i;
      if (locald != null)
      {
        locale = locald.f();
        i = locale.f();
      }
      do
      {
        do
        {
          if (j != 0) {
            break label261;
          }
          if (paramArrayOfInt[i] != paramInt2)
          {
            if (bool) {
              break label212;
            }
            if (paramArrayOfInt[i] != -paramInt2)
            {
              paramh1.a(locale);
              paramArrayOfInt[i] = (-paramInt2);
            }
          }
          locald = locald.i();
          if (j == 0) {
            break label141;
          }
          if (bool) {
            break label143;
          }
          locald = parame.i();
          if (locald == null) {
            break;
          }
          locale = locald.e();
          i = locale.f();
        } while (bool);
      } while (j != 0);
      if (paramArrayOfInt[i] != paramInt2)
      {
        if (bool) {
          break label302;
        }
        if (paramArrayOfInt[i] != -paramInt2)
        {
          paramh1.a(locale);
          paramArrayOfInt[i] = (-paramInt2);
        }
      }
      locald = locald.j();
      if (j == 0) {
        break;
      }
    }
    label136:
    label141:
    label143:
    label212:
    label226:
    return;
  }
  
  private static final b_ a(o paramo, int paramInt)
  {
    boolean bool = j.c;
    int i4 = j.b;
    int i = paramo.k();
    int j = (int)(Math.log(i) / Math.log(10.0D)) + 2;
    int[] arrayOfInt1 = new int[j];
    int[] arrayOfInt2 = new int[i];
    b_ localb_ = new b_();
    e[] arrayOfe = gb.a(paramo);
    int k = 0;
    if (k < i) {}
    while (bool)
    {
      arrayOfInt2[k] = 0;
      k++;
      if (bool) {
        break label100;
      }
      if (i4 != 0) {
        break label99;
      }
      if (i4 == 0) {
        break;
      }
    }
    arrayOfInt1[0] = i;
    label99:
    label100:
    int m = 1;
    if (m < j) {}
    int n;
    label230:
    while (bool)
    {
      int i2 = arrayOfInt1[(m - 1)];
      int[] arrayOfInt3 = a(paramo, arrayOfe, i2, m);
      arrayOfInt1[m] = arrayOfInt3[0];
      n = 0;
      if (bool) {
        break label313;
      }
      if (i4 != 0) {
        break label312;
      }
      int i1 = 1;
      if (i1 <= arrayOfInt1[(m - 1)]) {}
      while (bool)
      {
        if (i4 != 0) {
          break label230;
        }
        if (arrayOfInt3[i1] == 1)
        {
          arrayOfInt2[arrayOfe[(i1 - 1)].f()] = m;
          a(arrayOfe, n++, i1 - 1);
        }
        i1++;
        if (i4 == 0) {
          break;
        }
      }
      if (arrayOfInt1[m] < paramInt + 1)
      {
        int i3 = arrayOfInt1[m];
        if (i3 < paramInt) {}
        while (bool)
        {
          arrayOfInt2[arrayOfe[i3].f()] = m;
          i3++;
          if (bool) {
            break label292;
          }
          if (i4 != 0) {
            break label288;
          }
          if (i4 == 0) {
            break;
          }
        }
        arrayOfInt1[m] = paramInt;
        j = m + 1;
      }
      m++;
      if (i4 == 0) {
        break;
      }
    }
    label288:
    label292:
    label312:
    if (arrayOfInt1[(j - 1)] > paramInt)
    {
      label313:
      n = paramInt;
      if (n < arrayOfInt1[(j - 1)]) {}
      while (bool)
      {
        arrayOfInt2[arrayOfe[n].f()] = (j - 2);
        n++;
        if ((!bool) && (i4 != 0)) {
          break label401;
        }
        if (i4 == 0) {
          break;
        }
      }
      arrayOfInt1[(j - 1)] = paramInt;
    }
    localb_.a = j;
    localb_.b = arrayOfInt1;
    localb_.c = arrayOfe;
    localb_.e = arrayOfInt2;
    label401:
    return localb_;
  }
  
  private static void a(e[] paramArrayOfe, int paramInt1, int paramInt2)
  {
    e locale = paramArrayOfe[paramInt1];
    paramArrayOfe[paramInt1] = paramArrayOfe[paramInt2];
    paramArrayOfe[paramInt2] = locale;
  }
  
  static final class b_
  {
    int a;
    int[] b;
    e[] c;
    int[] e;
  }
  
  static final class a_
  {
    e[] a;
    int[] b;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.g.d

 * JD-Core Version:    0.7.0.1

 */